package net.bio;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.charset.StandardCharsets;

/**
 * @author 王霄
 * @date 2021/8/21 15:36
 */
public class BioClient {

    public static void main(String[] args) throws IOException, InterruptedException {
        var socket = new Socket();
        socket.connect(new InetSocketAddress(8888));
        OutputStream outputStream = socket.getOutputStream();
        while (true) {
            outputStream.write("你好".getBytes(StandardCharsets.UTF_8));
            Thread.sleep(5000);
        }
    }
}
